package ch5.CountDownLatchCase;

/**
 * web服务器启动代码
 */

public class ServerStarter {
    public static void main(String[] args) {
        // 执行所有服务
        ServiceManager.startServices();

        // 执行其他操作

        // 在所有其他操作执行结束后，检测服务启动状态
        boolean allIsOK;
        allIsOK = ServiceManager.checkServiceStatus();

        if (allIsOK) {
            System.out.println("All services were successfully started!");
        } else {
            System.err.println("Some service(s) failed to start, exiting JVM...");
            System.exit(1);
        }
    }
}
